package torres.map;

import java.io.Serializable;

/**
 * @author Torres
 * Represents a two-dimensional Cartesian coordinate
 */
@SuppressWarnings("serial")
public class Location implements Serializable {

		private int x;
		private int y;
		
		/**
		 * Creates a new Location of (-1, -1)
		 */
		public Location() {
			
			x = -1;
			y = -1;	
		}
		
		/**
		 * Creates a new Location of (x,y)
		 * @param x The x-coordinate of the location.
		 * @param y The y-coordinate of the location.
		 */
		public Location(int x, int y) {
			
			this.x = x;
			this.y = y;
		}
		
		/**
		 * Sets the x-coordinate of this Location to the specified value.
		 * @param x The new x-coordinate of this Location.
		 */
		public void setX(int x) {
			
			this.x = x;
		}
		
		/**
		 * Sets the y-coordinate of this Location to the specified value.
		 * @param y The new y-coordinate of this Location.
		 */
		public void setY(int y) {
			
			this.y = y;
		}
		
		/**
		 * Returns the current x-coordinate of this Location.
		 * @return The current x-coordinate of this Location.
		 */
		public int getX() {
			
			return x;
		}
		
		/**
		 * Returns the current y-coordinate of this Location.
		 * @return The current y-coordinate of this Location.
		 */
		public int getY() {
			
			return y;
		}
		
		/**
		 * Returns the String representation of this Location.
		 * @return The String representation of this Location.
		 */
		public String toString() {
			return new StringBuilder("x: ").append(x).append(" y: ").append(y).toString();
		}
}
